package problems.solved;

import java.util.ArrayList;
import java.util.List;

import utils.Utils;

public class Problem6 {
	public static void main(String[] args) {
		List<Integer> firstHundred = Utils.first(100);
		List<Integer> squared = new ArrayList<Integer>();
		for (int i : firstHundred) {
			squared.add(i*i);
		}
		long squaredSum = Utils.sumOfIntegers(firstHundred);
		squaredSum *= squaredSum;
		long sumOfSquares = Utils.sumOfIntegers(squared);
		
		System.out.printf("%d - %d = %d", squaredSum, sumOfSquares, squaredSum - sumOfSquares );
	}
}
